package com.panshi.modules.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.panshi.modules.domain.SysRole;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 857
 * @since 2020-07-29
 */
@Repository
public interface SysRoleMapper extends BaseMapper<SysRole> {

    List<SysRole> listSysRolesByUserId(@Param("userId")Integer id);

    //新增关系表维护
    int addRoleMenus(@Param("roleId")Integer roleId, List<String> list);

    //关系表,查roleId 对应的menuIds
    List<Integer> selectRoleMenuRelas(@Param("roleId")Integer roleId);

    //删除role时删除role-menu关系
    int delRoleMenusByRoleId(@Param("id") Integer id);

}

